<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/style_staff.css"/>
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>css/jquery-ui.css"/>
        <title>Blossom</title>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery-ui.min.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/jquery.blockui.js"></script>
        <script type="text/javascript" src="<?php echo base_url(); ?>js/checklogin.js"></script>


        <?php echo $_scripts; ?>
        <?php echo $_styles; ?>

        <script type="text/javascript">
            var BASE_URL = "<?php echo base_url() ?>";
            var SITE_URL = "<?php echo site_url() ?>";
            var UPDATE_SUCCESSFUL = "<?php echo lang("update_successful_msg"); ?>";
			var MSG_LANG_PLEASE_WAIT="<?php echo lang("please_wait"); ?>";		
			var CANCEL_LBL="<?php echo lang("global_lang_action_cancel"); ?>";
			var MSG_PENDING_TASK_NOTICE="<?php echo lang("setting_pending_task_notice"); ?>";
			var MSG_UPDATED_SUCCESSFUL="<?php echo lang("update_successful_msg"); ?>";
			
            $(document).ready(function() {
                $( ".datepicker" ).datepicker({
                    dateFormat: 'dd-mm-yy',
                    showAnim: 'slideDown'
                });

                $("#changerole").change(function(){
                    var role_id = $('#changerole').val();
                    $.ajax({
                        type: 'POST',
                        url: SITE_URL+'/changerole',
                        data: 'roleID='+role_id,
                        success: function(data){
                            location = data;
                            //window.location = data;
                        }
                    })
                });
                <?php                    
                    $url = current_url();                                                                                
                    if(strpos($url,site_url().'/children_profile') === FALSE AND strpos($url,site_url().'/progress_report') === FALSE){                        
                ?>		
                $.ajaxSetup({
                    beforeSend: function(){
                        $.blockUI({ message: null });
                    },
                    complete: function(){
                        $.unblockUI();
                    }
                });
                <?php
                    }
                ?>

                $("#langEnglish").click(function (){
                    $.blockUI({ message: null });
                    $.ajax({
                        type: 'GET',
                        url: SITE_URL+'/login/change_language/english',
                        success: function(){
                            $.blockUI({ message: null });
                            location.reload(true);
                        }
                    });
                    return false;
                });

                $("#langChinese").click(function (){
                    $.blockUI({ message: null });
                    $.ajax({
                        type: 'GET',
                        url: SITE_URL+'/login/change_language/chinese',
                        success: function(){
                            $.blockUI({ message: null });
                            location.reload(true);
                        }
                    });
                    return false;
                });

                /*
                                <a id="langEnglish" href="#">English</a>
                                <a id="langChinese" href="#">中文</a>
                 */
            });
        </script>
        <style type="text/css">
            .tab {
                font-family: arial, verdana, san-serif;
                font-size: 14px;
            }
            .asd {
                text-decoration: none;
                font-family: arial, verdana, san-serif;
                font-size: 13px;
                color: #FFD700;
            }
        </style>
        <script language="javascript" type="text/javascript">

            window.onerror = null;
            var bName = navigator.appName;
            var bVer = parseInt(navigator.appVersion);

            var IE4 = (bName == "Microsoft Internet Explorer" && bVer >= 4);
            var menuActive = 0;

            var menuOn = 0;
            var onLayer;
            var timeOn = null;


            function showLayer(layerName, aa) {
                $("#nav").find('div').css({
                    'visibility': 'hidden'

                });
                var x = document.getElementById(aa);
                var tt = findPosX(x);
                var ww = findPosY(x) + 20;


                if (timeOn != null) {
                    clearTimeout(timeOn);
                    hideLayer(onLayer);
                }
                if (IE4) {

                    $("#" + layerName).css({ 'left': tt,
                        'visibility': 'visible'

                    });
                }
                else {
                    if ($("#" + layerName).length != 0) {

                        var elementRef = $("#" + layerName);
                        elementRef.css({ 'visibility': 'visible', 'left': tt, 'top': ww });

                    }
                }

                onLayer = layerName;
                menuActive = 0;
            }

            function hideLayer(layerName) {
                if (menuActive == 0) {

                    if (IE4) {
                        $("#" + layerName).css({
                            'visibility': 'hidden'

                        });
                    }
                    else {
                        if ($("#" + layerName).length != 0) {

                            var elementRef = $("#" + layerName);
                            //elementRef.css({ 'visibility': 'visiblehidden' });
                            elementRef.css({ 'visibility': 'hidden' });

                        }
                    }
                }
            }

            function btnTimer() {
                timeOn = setTimeout("btnOut()", 300);

            }

            function btnOut(layerName) {
                if (menuActive == 0) {
                    hideLayer(onLayer);
                }
            }


            var item;
            function menuOver(itemName, ocolor) {
                item = itemName;
                itemName.style.backgroundColor = ocolor; //background color change on mouse over

                clearTimeout(timeOn);
                menuActive = 1;
            }

            function menuOut(itemName, ocolor) {
                if (item)

                itemName.style.backgroundColor = ocolor;
            menuActive = 0;
            timeOn = setTimeout("hideLayer(onLayer)", 100);
        }

        function findPosX(obj) {

            var curleft = 0;
            if (obj.offsetParent) {
                while (obj.offsetParent) {
                    curleft += obj.offsetLeft;

                    obj = obj.offsetParent;
                }
            }
            else if (obj.x)
                curleft += obj.x;

            return curleft;
        }

        function findPosY(obj) {
            var curtop = 0;
            if (obj.offsetParent) {

                while (obj.offsetParent) {
                    curtop += obj.offsetTop;
                    obj = obj.offsetParent;
                }
            }
            else if (obj.y)

            curtop += obj.y;
        return curtop;
    }

        </script>
    </head>

    <body>
        <div id="page">
            <div id="header">
                <div style="background-image: url(<?php echo base_url() ?>css/img/bg-tophead.gif); background-repeat: repeat-x;height: 5px;"> </div>
                <br class="clear" />
                <?php
                echo $menutop;
                ?>


                <div id="body" style="float: left;">
                    <?php echo $leftcontent; ?>
                </div>

                <div id="body_right" style="float: left; right-anchor: 150px; width: 70%; margin-left: 20px;">
                    <?php echo $rightcontent; ?>
                </div>


                <br class="clear" />
            </div>

            <div id="footer">
                <p><a target="_blank" href="<?php echo "http://www.blossomedugroup.com.sg" ?>"><?php echo lang('global_lang_copy_right'); ?></a></p>
            </div>
        </div>


    </body>
</html>





